<!doctype html>
<html> 
 <head> 
  <meta charset="utf-8"> 
  <title>表格 - 页面元素 - Layui</title> 
  <meta name="renderer" content="webkit"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes"> 
  <meta name="format-detection" content="telephone=no"> 
  <link rel="stylesheet" href="/layui/dist/css/layui.css" media="all"> 
  <link rel="stylesheet" href="/static/css/global.css" media="all"> 
 </head> 
 <body> 
  <div class="layui-header header header-doc"> 
   <div class="layui-container"> <a class="logo" href="/index.html"> <img src="/static/images/layui/logo.png" alt="layui"> </a> 
    <div class="layui-form layui-hide-xs component" lay-filter="LAY-site-header-component"></div> 
    <div class="layui-hide-xs site-notice"></div> 
    <ul class="layui-nav" id="LAY_NAV_TOP"> 
     <li class="layui-nav-item layui-this"> <a href="/doc/index.html">文档</a> </li> 
     <li class="layui-nav-item "> <a href="/demo/index.html">示例</a> </li> 
     <li class="layui-nav-item"> <a href="javascript:;"> <!--<span class="layui-badge-dot" style="left:0; right: auto; margin: -4px 0 0 5px;"></span>--> 周边 </a> 
      <dl class="layui-nav-child layui-nav-child-c"> 
       <dd class="layui-hide-sm layui-show-xs" lay-unselect> <a href="https://gitee.com/sentsin/layui/issues" target="_blank" rel="nofollow">问题反馈</a> 
        <hr> 
       </dd> 
       <dd lay-unselect>
        <a href="/alone.html" target="_blank" lay-unselect>独立组件</a>
       </dd> 
       <dd lay-unselect>
        <a href="//fly.layui.com/extend/" target="_blank">扩展组件</a>
       </dd> 
      </dl> </li> 
     <li class="layui-nav-item layui-hide-xs"> <a href="//gitee.com/sentsin/layui/issues" target="_blank" rel="nofollow">反馈</a> </li> 
    </ul> 
   </div> 
  </div> <!-- 让IE8/9支持媒体查询，从而兼容栅格 --> <!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> 
  <ul class="site-dir"> 
   <li><a href="#default"><cite>常规用法</cite></a></li> 
   <li><a href="#attr"><cite>基础属性</cite></a></li> 
   <li><a href="#skin"><cite>风格</cite></a></li> 
   <li><a href="#size"><cite>尺寸</cite></a></li> 
   <li><a href="/doc/modules/table.html"><cite>表格动态操作</cite></a></li> 
  </ul> 
  <div class="layui-container layui-row"> 
   <div class="layui-col-md3"> 
    <div class="layui-panel site-menu"> 
     <ul class="layui-menu layui-menu-lg"> 
      <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: true}"> 
       <div class="layui-menu-body-title">
         基础说明 
       </div> 
       <hr> 
       <ul> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/index.html"> <span>开始使用 </span> <span class="layui-font-12 layui-font-gray">Getting Started</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/infrastructure.html"> <span>底层方法 </span> <span class="layui-font-12 layui-font-gray">基础支撑</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/element.html"> <span>页面元素 </span> <span class="layui-font-12 layui-font-gray">规范 公共类 属性</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/modules.html"> <span>模块规范 </span> <span class="layui-font-12 layui-font-gray">使用 扩展</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/faq.html"> <span>常见问题 </span> <span class="layui-font-12 layui-font-gray">FAQ</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/changelog.html"> <span>更新日志 </span> <span class="layui-font-12 layui-font-gray">changelog</span> <span class="layui-badge-dot"></span> </a> 
         </div> </li> 
       </ul> </li> 
      <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: true}"> 
       <div class="layui-menu-body-title">
         页面元素 
       </div> 
       <hr> 
       <ul> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/layout.html"> <span>布局 </span> <span class="layui-font-12 layui-font-gray">栅格 后台管理布局</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/color.html"> <span>颜色 </span> <span class="layui-font-12 layui-font-gray">主色调 颜色搭配</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/icon.html"> <span>图标 </span> <span class="layui-font-12 layui-font-gray">iconfont 字体图标</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/anim.html"> <span>动画 </span> <span class="layui-font-12 layui-font-gray">内置 CSS3 动画</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/button.html"> <span>按钮 </span> <span class="layui-font-12 layui-font-gray">button</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/form.html"> <span>表单 </span> <span class="layui-font-12 layui-font-gray">form 元素集合</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/nav.html"> <span>导航 </span> <span class="layui-font-12 layui-font-gray">nav 面包屑</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/menu.html"> <span>菜单 </span> <span class="layui-font-12 layui-font-gray">menu 基础菜单</span> <span class="layui-badge-dot"></span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/tab.html"> <span>选项卡 </span> <span class="layui-font-12 layui-font-gray">Tabs 切换</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/progress.html"> <span>进度条 </span> <span class="layui-font-12 layui-font-gray">progress</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/panel.html"> <span>面板 </span> <span class="layui-font-12 layui-font-gray">panel 卡片 折叠</span> </a> 
         </div> </li> 
        <li class="layui-menu-item-checked2"> 
         <div class="layui-menu-body-title"> <a href="/doc/element/table.html"> <span>表格 </span> <span class="layui-font-12 layui-font-gray">静态 table</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/badge.html"> <span>徽章 </span> <span class="layui-font-12 layui-font-gray">小圆点 小边框</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/timeline.html"> <span>时间线 </span> <span class="layui-font-12 layui-font-gray">timeline</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/auxiliar.html"> <span>辅助 </span> <span class="layui-font-12 layui-font-gray">引用 字段集 横线等</span> </a> 
         </div> </li> 
       </ul> </li> 
      <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: true}"> 
       <div class="layui-menu-body-title">
         内置模块 
       </div> 
       <hr> 
       <ul> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/layer.html"> <span>弹出层 </span> <span class="layui-font-12 layui-font-gray">layer</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/laydate.html"> <span>日期与时间选择 </span> <span class="layui-font-12 layui-font-gray">laydate</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/laypage.html"> <span>分页 </span> <span class="layui-font-12 layui-font-gray">laypage</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/laytpl.html"> <span>模板引擎 </span> <span class="layui-font-12 layui-font-gray">laytpl</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/table.html"> <span>数据表格 </span> <span class="layui-font-12 layui-font-gray">table</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/form.html"> <span>表单 </span> <span class="layui-font-12 layui-font-gray">form</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/upload.html"> <span>文件上传 </span> <span class="layui-font-12 layui-font-gray">upload</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/dropdown.html"> <span>下拉菜单 </span> <span class="layui-font-12 layui-font-gray">dropdown</span> <span class="layui-badge-dot"></span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/transfer.html"> <span>穿梭框 </span> <span class="layui-font-12 layui-font-gray">transfer</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/tree.html"> <span>树形组件 </span> <span class="layui-font-12 layui-font-gray">tree</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/colorpicker.html"> <span>颜色选择器 </span> <span class="layui-font-12 layui-font-gray">colorpicker</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/element.html"> <span>常用元素操作 </span> <span class="layui-font-12 layui-font-gray">element</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/slider.html"> <span>滑块 </span> <span class="layui-font-12 layui-font-gray">slider</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/rate.html"> <span>评分 </span> <span class="layui-font-12 layui-font-gray">rate</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/carousel.html"> <span>轮播 </span> <span class="layui-font-12 layui-font-gray">carousel</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/flow.html"> <span>流加载 </span> <span class="layui-font-12 layui-font-gray">flow</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/util.html"> <span>工具组件 </span> <span class="layui-font-12 layui-font-gray">util</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/code.html"> <span>代码高亮显示 </span> <span class="layui-font-12 layui-font-gray">code</span> </a> 
         </div> </li> 
       </ul> </li> 
     </ul> 
    </div> 
    <div class="layui-hide-v">
      - 
    </div> 
   </div> 
   <div class="layui-col-md9 site-content"> 
    <h1 class="site-h1">表格 - 页面元素</h1> 
    <blockquote class="site-text layui-elem-quote">
      本篇为你介绍表格的HTML使用，你将通过内置的自定义属性对其进行风格的多样化设定。<em>请注意：</em>这仅仅局限于呈现基础表格，如果你急切需要的是数据表格（<em>datatable</em>），那么你应该详细阅读：<a href="/doc/modules/table.html">table模块</a> 
    </blockquote> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="default">常规用法</a></legend> 
    </fieldset> 
    <table class="layui-table"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>昵称</th> 
       <th>加入时间</th> 
       <th>签名</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>贤心</td> 
       <td>2016-11-29</td> 
       <td>人生就像是一场修行</td> 
      </tr> 
      <tr> 
       <td>许闲心</td> 
       <td>2016-11-28</td> 
       <td>于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…</td> 
      </tr> 
      <tr> 
       <td>sentsin</td> 
       <td>2016-11-27</td> 
       <td> Life is either a daring adventure or nothing.</td> 
      </tr> 
     </tbody> 
    </table> 
    <div class="site-text"> 
     <pre class="layui-code" lay-title="HTML">&lt;table class="layui-table"&gt;
  &lt;colgroup&gt;
    &lt;col width="150"&gt;
    &lt;col width="200"&gt;
    &lt;col&gt;
  &lt;/colgroup&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;昵称&lt;/th&gt;
      &lt;th&gt;加入时间&lt;/th&gt;
      &lt;th&gt;签名&lt;/th&gt;
    &lt;/tr&gt; 
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;贤心&lt;/td&gt;
      &lt;td&gt;2016-11-29&lt;/td&gt;
      &lt;td&gt;人生就像是一场修行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;许闲心&lt;/td&gt;
      &lt;td&gt;2016-11-28&lt;/td&gt;
      &lt;td&gt;于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
      </pre> 
    </div> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="attr">基础属性</a></legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>静态表格支持以下基础属性，可定义不同风格/尺寸的表格样式：</p> 
    </div> 
    <table class="layui-table"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>属性名</th> 
       <th>属性值</th> 
       <th>备注</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>lay-even</td> 
       <td>无</td> 
       <td>用于开启 <em>隔行</em> 背景，可与其它属性一起使用</td> 
      </tr> 
      <tr> 
       <td>lay-skin="属性值"</td> 
       <td> line （行边框风格） <br>row （列边框风格） <br>nob （无边框风格） </td> 
       <td> 若使用默认风格不设置该属性即可 </td> 
      </tr> 
      <tr> 
       <td>lay-size="属性值"</td> 
       <td> sm （小尺寸） <br>lg （大尺寸） </td> 
       <td> 若使用默认尺寸不设置该属性即可 </td> 
      </tr> 
     </tbody> 
    </table> 
    <div class="site-text"> 
     <p>将你所需要的基础属性写在table标签上即可，如（一个带有隔行背景，且行边框风格的大尺寸表格）：</p> 
    </div> 
    <pre class="layui-code" lay-title="HTML">&lt;table lay-even lay-skin="line" lay-size="lg"&gt;
…
&lt;/table&gt;
    </pre> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="skin">表格其它风格</a></legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>除了默认的表格风格外，我们还提供了其它几种风格，你可以按照实际需求自由设定</p> 
    </div> 
    <table class="layui-table" lay-skin="line"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>昵称</th> 
       <th>加入时间</th> 
       <th>签名</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>贤心</td> 
       <td>2016-11-29</td> 
       <td>人生就像是一场修行</td> 
      </tr> 
      <tr> 
       <td>许闲心</td> 
       <td>2016-11-28</td> 
       <td>于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…</td> 
      </tr> 
      <tr> 
       <td>sentsin</td> 
       <td>2016-11-27</td> 
       <td> Life is either a daring adventure or nothing.</td> 
      </tr> 
     </tbody> 
    </table> 
    <table class="layui-table" lay-skin="row"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>昵称</th> 
       <th>加入时间</th> 
       <th>签名</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>贤心</td> 
       <td>2016-11-29</td> 
       <td>人生就像是一场修行</td> 
      </tr> 
      <tr> 
       <td>许闲心</td> 
       <td>2016-11-28</td> 
       <td>于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…</td> 
      </tr> 
      <tr> 
       <td>sentsin</td> 
       <td>2016-11-27</td> 
       <td> Life is either a daring adventure or nothing.</td> 
      </tr> 
     </tbody> 
    </table> 
    <table class="layui-table" lay-even lay-skin="nob"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>昵称</th> 
       <th>加入时间</th> 
       <th>签名</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>贤心</td> 
       <td>2016-11-29</td> 
       <td>人生就像是一场修行</td> 
      </tr> 
      <tr> 
       <td>许闲心</td> 
       <td>2016-11-28</td> 
       <td>于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…</td> 
      </tr> 
      <tr> 
       <td>sentsin</td> 
       <td>2016-11-27</td> 
       <td> Life is either a daring adventure or nothing.</td> 
      </tr> 
     </tbody> 
    </table> 
    <div class="site-text"> 
     <pre class="layui-code" lay-title="HTML">&lt;table class="layui-table" <em>lay-skin="line"</em>&gt;
  行边框表格（内部结构参见右侧目录“常规用法”）
&lt;/table&gt;
 
&lt;table class="layui-table" <em>lay-skin="row"</em>&gt;
  列边框表格（内部结构参见右侧目录“常规用法”）
&lt;/table&gt;
 
&lt;table class="layui-table" lay-even <em>lay-skin="nob"</em>&gt;
  无边框表格（内部结构参见右侧目录“常规用法”）
&lt;/table&gt;
      </pre> 
    </div> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="size">表格其它尺寸</a></legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>除了默认的表格尺寸外，我们还提供了其它几种尺寸，你可以按照实际需求自由设定</p> 
    </div> 
    <table class="layui-table" lay-size="sm"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>昵称</th> 
       <th>加入时间</th> 
       <th>签名</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>贤心</td> 
       <td>2016-11-29</td> 
       <td>人生就像是一场修行</td> 
      </tr> 
      <tr> 
       <td>许闲心</td> 
       <td>2016-11-28</td> 
       <td>于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…</td> 
      </tr> 
      <tr> 
       <td>sentsin</td> 
       <td>2016-11-27</td> 
       <td> Life is either a daring adventure or nothing.</td> 
      </tr> 
     </tbody> 
    </table> 
    <table class="layui-table" lay-size="lg"> 
     <colgroup> 
      <col width="150"> 
      <col width="200"> 
      <col> 
     </colgroup> 
     <thead> 
      <tr> 
       <th>昵称</th> 
       <th>加入时间</th> 
       <th>签名</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>贤心</td> 
       <td>2016-11-29</td> 
       <td>人生就像是一场修行</td> 
      </tr> 
      <tr> 
       <td>许闲心</td> 
       <td>2016-11-28</td> 
       <td>于千万人之中遇见你所遇见的人，于千万年之中，时间的无涯的荒野里…</td> 
      </tr> 
      <tr> 
       <td>sentsin</td> 
       <td>2016-11-27</td> 
       <td> Life is either a daring adventure or nothing.</td> 
      </tr> 
     </tbody> 
    </table> 
    <div class="site-text"> 
     <pre class="layui-code" lay-title="HTML">&lt;table class="layui-table" <em>lay-size="sm"</em>&gt;
  小尺寸表格（内部结构参见右侧目录“常规用法”）
&lt;/table&gt;
 
&lt;table class="layui-table" <em>lay-size="lg"</em>&gt;
  大尺寸表格（内部结构参见右侧目录“常规用法”）
&lt;/table&gt;
      </pre> 
    </div> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend>结语</legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>再次温馨提醒：如果你需要对表格进行排序、数据交互等一系列功能性操作，你需要进一步阅读 layui 的重要组成：<a href="/doc/modules/table.html">table模块</a></p> 
    </div> 
    <div class="layui-elem-quote"> 
     <p>layui - 在每一个细节中，用心与你沟通</p> 
    </div> 
   </div> 
  </div> 
  <div class="layui-footer footer footer-doc"> 
   <p> Copyright © 2021 <a href="/index.html">layui.itmtr.cn</a> MIT Licensed</p> 
   <p> </p>
  </div> 
  <script>
window.global = {
  pageType: 'doc'
  ,preview: function(){
    var preview = document.getElementById('LAY_preview');
    return preview ? preview.innerHTML : '';
  }()
};
</script> 
  <div class="site-tree-mobile layui-hide"> <i class="layui-icon layui-icon-spread-left"></i> 
  </div> 
  <div class="site-mobile-shade"></div> 
  <script src="/layui/dist/layui.js" charset="utf-8"></script> 
  <script>
layui.config({
  base: '/static/lay/modules/layui/'
  ,version: '1632659138225'
}).use('global');
</script>  
 </body>
</html>